'use strict';
module.exports = app => {
    const { BIGINT, STRING, TEXT, JSON, DATE } = app.Sequelize;
    const TortWordHistories = app.model.define('tort_word_histories', {
        id: {
            type: BIGINT,
            field: 'id',
            primaryKey: true,
            autoIncrement: true,
        },
        tort_word_id: BIGINT,
        word: TEXT,
        source: STRING,
        hoder: TEXT,
        address: TEXT,
        nice_cl: JSON,
        status: STRING,
        app_data: DATE,
    }, {
        updatedAt: 'updated_at',
    });
    TortWordHistories.associate = () => {
        app.model.TortWordHistories.hasOne(app.model.TortWords, {
            foreignKey: 'tort_word_id',
            targetKey: 'tort_word_id',
            as: 'tortWords',
        });
    };
    return TortWordHistories;
};